﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace ContactSMS.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class addUserTableColumnPhoneEmail : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.RenameColumn(
                name: "avatar",
                table: "T_User",
                newName: "Avatar");

            migrationBuilder.AddColumn<string>(
                name: "Email",
                table: "T_User",
                type: "VARCHAR(100)",
                nullable: false,
                defaultValue: "",
                comment: "邮箱")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Phone",
                table: "T_User",
                type: "VARCHAR(80)",
                nullable: false,
                defaultValue: "",
                comment: "手机号")
                .Annotation("MySql:CharSet", "utf8mb4");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "Email",
                table: "T_User");

            migrationBuilder.DropColumn(
                name: "Phone",
                table: "T_User");

            migrationBuilder.RenameColumn(
                name: "Avatar",
                table: "T_User",
                newName: "avatar");
        }
    }
}
